<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@page import="java.util.Map"%>
<%@page import="java.util.HashMap"%>
<%@page import="java.util.ArrayList"%>
<html:html>
<head>
<html:base />
<title>Sistema CUCEI</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="css/formas.css" rel="stylesheet" type="text/css">
<link href="css/calendar.css" rel="stylesheet" type="text/css">
<style type="text/css">
#div_cal {
background-color:#FF9933;
	position:absolute;
}
</style>
<script LANGUAGE="JavaScript" type="text/javascript" src="js/AnchorPosition.js"></script>
<script LANGUAGE="JavaScript" type="text/javascript" src="js/PopupWindow.js"></script>
<script LANGUAGE="JavaScript" type="text/javascript" src="js/date.js"></script>
<script LANGUAGE="JavaScript" type="text/javascript" src="js/CalendarPopup.js"></script>
<script language="javascript" type="text/javascript" src="js/util.js"></script>
<script language="javascript" type="text/javascript">
var cal_fechas;
cal_fechas = new CalendarPopup('div_cal');
function fnc_validarForma(forma){
	var bol_retVal = true;
	var str_errores = "";
	
	if( Trim(forma.str_expediente.value) == "" ){
		str_errores += " - <bean:message key='DraftManage.Exp'/> <bean:message key='errors.required'/>\n";
	}
	
	if( Trim(forma.str_asunto.value) == "" ){
		str_errores += " - <bean:message key='DraftList.Subject'/> <bean:message key='errors.required'/>\n";
	}
	
	var int_numeroVa = Trim(forma.int_numeroReunion.value);
	if( int_numeroVa == "" ){
		str_errores += " - <bean:message key='DraftManage.MeetingNo'/> <bean:message key='errors.required'/>\n";
	}else if( !esNumero(int_numeroVa,0) || parseInt(int_numeroVa) < 0 ){
		str_errores += " - <bean:message key='DraftManage.MeetingNo'/> <bean:message key='errors.integer'/>\n";
	}
	
	if( Trim(forma.int_responsable.value) == "" ){
		str_errores += " - <bean:message key='DraftManage.MeetingOwner'/> <bean:message key='errors.required'/>\n";
	}
	
	if( Trim(forma.str_lugar.value) == "" ){
		str_errores += " - <bean:message key='DraftManage.Place'/> <bean:message key='errors.required'/>\n";
	}
	
	if( Trim(forma.str_fechaReunion.value) == "" ){
		str_errores += " - <bean:message key='DraftManage.MeetingDate'/> <bean:message key='errors.required'/>\n";
	}
	
	var str_reunionTime = Trim(forma.str_horaReunion.value);
	if( str_reunionTime == "" ){
		str_errores += " - <bean:message key='DraftManage.HourPre'/> <bean:message key='errors.required'/>\n";
	}else if(!TestString(str_reunionTime)){
		str_errores += " - <bean:message key='DraftManage.HourPre'/> <bean:message key='errors.hour'/>\n";
	}
	
	var str_startTime = Trim(forma.str_horaInicio.value);
	if(str_startTime == ""){
		str_errores += " - <bean:message key='DraftManage.HourIni'/> <bean:message key='errors.required'/>\n";
	}else if(!TestString(str_startTime)){
		str_errores += " - <bean:message key='DraftManage.HourIni'/> <bean:message key='errors.hour'/>\n";
	}
	
	var str_endTime = Trim(forma.str_horaFin.value);
	if(str_endTime == ""){
		str_errores += " - <bean:message key='DraftManage.HourEnd'/> <bean:message key='errors.required'/>\n";
	}else if(!TestString(str_endTime)){
		str_errores += " - <bean:message key='DraftManage.HourEnd'/> <bean:message key='errors.hour'/>\n";
	}
	
	if( Trim(forma.str_ordenDia.value) == "" ){
		str_errores += " - <bean:message key='DraftManage.DayOrder'/> <bean:message key='errors.required'/>\n";
	}
	
	if( str_errores != "" ){
		bol_retVal = false;
		alert( " <bean:message key='Application.Error(s)'/> : \n" + str_errores );
	}
	return bol_retVal;
}
function fnc_closeReview(){
	if('<bean:write name="DraftForm" property="str_cerrada"/>' == '1'  || '<bean:write name="ses_usuario" property="per_minutas"/>' == '1'   ){
		var forma = document.forms[0];
		forma.btn_cerrar.disabled = true;
		forma.btn_aceptar.disabled = true;
		forma.int_min.disabled = true;
		forma.str_expediente.disabled = true;
		forma.str_asunto.disabled = true;
		forma.int_numeroReunion.disabled = true;
		forma.str_responsable.disabled = true;
		linkResponsable =  document.getElementById("a_responsable");
		linkResponsable.href = "javascript:void(0);";
		forma.str_lugar.disabled = true;
		forma.str_fechaReunion.disabled = true;
		linkFechaReunion =  document.getElementById("a_fechaReunion");
		linkFechaReunion.href = "javascript:void(0);";
		forma.str_fechaReunion.disabled = true;
		forma.str_horaReunion.disabled = true;
		forma.str_horaInicio.disabled = true;
		forma.str_horaFin.disabled = true;
		forma.str_ordenDia.disabled = true;
	}
}
<logic:present name="req_msg">
	alert("<bean:write name='req_msg'/>");
</logic:present>
</script>
</head>
<body onload="fnc_closeReview();">
<div id="div_cal"></div>
<html:form action="draft_save" focus="str_expediente" onsubmit="return fnc_validarForma(this);">
	<html:hidden property="action" value="saveDraft"/>
	<table cellpadding="0" cellspacing="0" class="formas">
		<tr>
			<td>
			<table cellpadding="0" cellspacing="0" class="barraNavegacion">
				<tr>
					<td><html:link action="/academy_welcome?action=selectAcademy" styleClass="barraNavegacion"><img src="images/icn_liga.gif" border="0"><bean:message key="AcademyWelcome.Init"/></html:link>
						<html:link action="/academy_list" styleClass="barraNavegacion"><img src="images/icn_liga.gif" border="0"><bean:message key="Menu.AcademyHeader"/></html:link>
						<html:link action="/draft_list.do?action=listDrafts" styleClass="barraNavegacion"><img src="images/icn_liga.gif" border="0"><bean:message key="Menu.Draft"/></html:link>
					</td>
				</tr>
			</table>
			<table cellpadding="0" cellspacing="0" class="titulo">
				<tr>
					<td class="iconos_imgs"><a href="mailto:<bean:message key="Application.mailto"/>"><img
						src="images/icn_correo.gif" width="18" height="18"
						border="0"></a></td>
					<td class="txt_titulo"><bean:message key="DraftManage.GralData"/>&nbsp;</td>
				</tr>
			</table>
			<table cellpadding="0" cellspacing="2" class="info_formas">
			<tr>         			
	        	<td>&nbsp;</td>
    		</tr>
			<tr>
				<td colspan="4">
					<table align="right" cellpadding="0" cellspacing="0">
						<tr> 				
							<td>&nbsp;
								<input type="button" value=<bean:message key="Agreement"/> onclick= "location.href='agreement_list.do'" />
							</td>
							<td>&nbsp;
								<input type="button" value=<bean:message key="Document"/> onclick= "location.href='document_list.do'" />
							</td>
							<td>&nbsp;
								<input type="button" value=<bean:message key="Assistants"/> onclick= "location.href='assistant_list.do'" />
							</td>
							<td>&nbsp;
								<input type="button" value=<bean:message key="Observations"/> onclick= "location.href='observation_add.do?action=addObservation'" />
							</td>
							<td>&nbsp;
								<input type="button" name="btn_cerrar" value=<bean:message key="Application.Close"/> onclick= "if(confirm('<bean:message key="DraftList.confirmClose"/>?'))location.href='draft_close.do?action=closeDrafts'" />
							</td>	
						</tr>
						</table>
					</td>
				<tr>
					<td colspan="4" class="formas-encabezado"><bean:message key="DraftManage.Info"/></td>
				</tr>
				<tr>
					<td colspan="4" class="">&nbsp;</td>
				</tr>
				<tr>
					<td class=""><bean:message key="DraftList.Draft"/></td>
					<td colspan="3" class=""><html:text property="int_min" readonly="true"></html:text>
				</tr>
				<tr>
					<td class=""><bean:message key="DraftManage.Exp"/></td>
					<td colspan="3" class="">
						<html:text property="str_expediente" maxlength="15" indexed="1"></html:text>
					</td>
				</tr>
				<tr>
					<td class=""><bean:message key="DraftList.Subject"/></td>
					<td class="">
						<html:text property="str_asunto" maxlength="50" indexed="2"/>
					</td>
					<td colspan="2" class="">
						<bean:message key="DraftManage.MeetingOwner"/>
					</td>
				</tr>
				<tr>
					<td class=""><bean:message key="DraftManage.MeetingNo"/></td>
					<td class="">
						<html:text property="int_numeroReunion" maxlength="22" indexed="3"/>
					</td>
					<td class="" align="right">
						<html:hidden property="int_responsable" />						
					</td>
					<td class="">
						<html:text property="str_responsable"  indexed="4" size="25" readonly="true"/>&nbsp;<a name="a_responsable" href="javascript:var win = centerPopUp( 'owner_search.do', 'OwnerSearch',  430,270, 'YES' );"><html:img page="/images/usuario.gif" border="0"/></a>
					</td>
				</tr>
				<tr>
					<td class=""><bean:message key="DraftManage.Place"/></td>

					<td colspan="3" class="">
						<html:text property="str_lugar" maxlength="50" indexed="5"/>
					</td>
				</tr>
				<tr>
					<td class=""><bean:message key="DraftManage.MeetingDate"/></td>
					<td class="">
						<html:text property="str_fechaReunion" size="12" maxlength="12" readonly="true"/>
						<a name="a_fechaReunion" href="javascript: cal_fechas.select(document.getElementById('str_fechaReunion'),'cal_img','yyyy/MM/dd');"  indexed="6">
								<img name="cal_img" src="images/img_calendario.gif" border="0" width="24" height="24" alt=""/>
						</a>
					</td>
					<td class=""><bean:message key="DraftManage.HourPre"/></td>
					<td class="">
						<html:text property="str_horaReunion" maxlength="5" indexed="7"/>
					</td>
				</tr>

				<tr>
					<td class=""><bean:message key="DraftManage.HourIni"/></td>
					<td class="">
						<html:text property="str_horaInicio" maxlength="5" indexed="8"/>
						
					</td>
					<td class=""><bean:message key="DraftManage.HourEnd"/></td>
					<td class="">
						<html:text property="str_horaFin" maxlength="5" indexed="9"/>
					</td>
				</tr>
				<tr>
					<td colspan="4" class="">&nbsp;</td>

				</tr>
				<tr>
					<td colspan="4" class="formas-encabezado"><bean:message key="DraftManage.DayOrder"/></td>
				</tr>
				<tr>
					<td colspan="4" class="">&nbsp;</td>
				</tr>
				<tr>
					<td colspan="4">
					<div align="center">
						<html:textarea property="str_ordenDia" cols="70" rows="7" indexed="10"/>
					</div>
					</td>
				</tr>
				<tr>
					<td colspan="4">
						<div align="center">
							<html:submit property="btn_aceptar" indexed="11"><bean:message key="Application.Accept" /></html:submit>
							<html:button property="btn_cancelar" onclick="location.href = 'draft_list.do?action=listDrafts';" indexed="12"><bean:message key="Application.Cancel"/></html:button>
						</div>
					</td>
				</tr>
				<tr>
					<td colspan="4">
					<div align="center"></div>
					</td>
				</tr>
			</table>
			</td>
		</tr>
	</table>
</html:form>
<p>&nbsp;</p>
</body>
</html:html>
